package com.woniuxy.carlife.carlifecomprehensiveweb.mapper;

import com.woniuxy.carlife.carlifecomprehensiveweb.domain.Rescue;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniuxy.carlife.carlifecomprehensiveweb.dto.RescueDto;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @ClassName: RescueMapper
 *@Description: 道路救援dao层
 * @author: yanzhongliang     
 * @date: 2021-04-05
 */

public interface RescueMapper extends BaseMapper<Rescue> {

    /**
     * 功能描述〈根据车牌号查询救援记录〉
     * @author: yanzhongliang
     * @param: rescueLicense
     * @return: RescueDto
     * @Date 2021/4/15 17:29
     * @throws
     */

    @Select("SELECT  " +
            "rescue_id, " +
            "rescue_time, " +
            "rescue_license, " +
            "rescue_phone, " +
            "rescue_user_name, " +
            "rescue_image, " +
            "rescue_address, " +
            "rescue_price, " +
            "rescue_vehicle, " +
            "rescue_store, " +
            "rescue_store_phone, " +
            "rescue_precision, " +
            "rescue_latitude " +
            "FROM " +
            "t_rescue " +
            "WHERE rescue_license=#{rescueLicense}")
    public List<RescueDto> getRescueListAndRescueLicense(String rescueLicense);

}
